package com.ym.manager.admin.user.model;

import com.ym.utils.DateHandler;
import com.ym.utils.StringHandler;

/**
 * @Author 但何非
 * @Date 2022/11/16 14:05
 * @ClassName: withdrawRecord
 * @Description:
 * @Version:
 */
public class WithdrawRecord {
    public long id;
    public String nickName;
    public int withdraw_status;
    public long amount;
    public long withdraw_amount;
    public long fee;
    public String raw_add_time;
    public long taskTime;

    public WithdrawRecordVo toVo(){
        WithdrawRecordVo withdrawRecordVo = new WithdrawRecordVo();
        withdrawRecordVo.id = this.id;
        withdrawRecordVo.nickName = this.nickName;
        withdrawRecordVo.withdraw_status = this.withdraw_status();
        withdrawRecordVo.amount = StringHandler.fenToYuan(this.amount+"");
        withdrawRecordVo.withdraw_amount = StringHandler.fenToYuan(this.withdraw_amount+"");
        withdrawRecordVo.fee = StringHandler.fenToYuan(this.fee+"");

        if(!StringHandler.isEmpty(this.raw_add_time)){
            if(this.raw_add_time.length()>19){
                withdrawRecordVo.raw_add_time = this.raw_add_time.substring(0,19);
            }else{
                withdrawRecordVo.raw_add_time = this.raw_add_time;
            }
        }
        withdrawRecordVo.taskTime = DateHandler.getLongFormatDateStr(this.taskTime);
        return withdrawRecordVo;
    }
    public String withdraw_status(){
        switch (this.withdraw_status){
            case 1 :
                return "提现中";
            case 2 :
                return "提现成功";
            case 3 :
                return "提现失败";
            case 4 :
                return "提现审核";
            case 5 :
                return "提现异常";
            case 6 :
                return "处理中";
            case 7 :
                return "冻结中";
            default:
                return "";
        }
    }
}
